fix(a11y): add dark-theme overrides for hardcoded light-theme colours#14839
Draft
skjnldsv wants to merge 1 commit into
Draft
fix(a11y): add dark-theme overrides for hardcoded light-theme colours#14839skjnldsv wants to merge 1 commit into
skjnldsv wants to merge 1 commit into
Conversation
The recent BITV contrast fixes hardcoded colours that were chosen for the white (light) background. The sphinx-rtd-dark-mode plugin switches the content background to ~#141414 and code bg to #2d2d2d, making those values fail WCAG AA in dark mode: - .rst-content a: #2474a4 → 3.6:1 on #141414 (needs 4.5:1) Also silently overrides the plugin's --dark-link-color variable. - code color: #c0392b !important → 2.4:1 on #2d2d2d (needs 4.5:1) The !important fully defeats the plugin's dark-mode rule. - .wy-form-search-icon: #555 → ~1.7:1 on #0b152d sidebar (invisible) Add html[data-theme="dark"] overrides that restore proper contrast without touching the existing light-theme rules: - Links: defer to var(--dark-link-color, #249ee8) (~6.1:1) - Inline code: #ff7878 (~4.9:1 on #2d2d2d) - Search icon: #aaa Closes #14831 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
88715fd to
52f7de9
Compare
Contributor
📖 Documentation PreviewNo RST documentation pages changed in this PR. Last updated: Wed, 13 May 2026 06:13:01 GMT |
Contributor
|
@skjnldsv can you please add screenshots so that we directly see what changed? |
Member
Author
Yeah, I was about to, but I spotted some more issues |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
☑️ Resolves
The recent BITV contrast fixes (#14827, #14828, #14829, #14830) hardcoded colours chosen for the white/light background. The
sphinx-rtd-dark-modeplugin switches backgrounds to#141414(content) and#2d2d2d(code), making those values fail WCAG AA in dark mode:.rst-content a#2474a4#141414--dark-link-colorcode#c0392b !important#2d2d2d!importantdefeats plugin'shtml[data-theme="dark"]rule.wy-form-search-icon#555#0b152dAdds
html[data-theme="dark"]overrides scoped to dark mode only — no changes to existing light-theme rules:var(--dark-link-color, #249ee8)(~6.1:1 on#141414)#ff7878(~4.9:1 on#2d2d2d)#aaa🖼️ Screenshots
✅ Checklist
codespellor similar and addressed any spelling issues